<?php
session_start();

include_once dirname(__FILE__).'/../../db/rdb/factory/RDBDAOFactory.php';


// $_POST['folder_pk'] = 1;
if(isset($_POST['folder_pk'])) {
	$rdbFactory = DAOFactory::getDAOFactory(DAOFactory::$RDB);
	$reqDAO = $rdbFactory->getRequirementDAO();
	
	$folder = new ProjectFolder($_POST["folder_pk"], '', '');
	
	$reqs = $reqDAO->getRequirementByFolder($folder);
	
	$reqList = array();
	
	foreach ($reqs as $req) {
		$reqList[] = array(
				'id' => $req->getArtifactPK(),
				'name' => $req->getArtifactName(),
				'date' => time(),
				'user' => 'user name'
				);	
	}
	
	echo json_encode($reqList);
}

?>